package com.hnevc.caoliuye;

import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");//输出字符串
        String str = sc.next();
        int num = 0;
        for (int i = 0; i < str.length(); i++) {//for循环
            try {
                Integer.parseInt(str.substring(i, (i + 1)));
                num = num + 1;

            } catch (Exception e) {
            }
        }
        System.out.println("字符出现" + num + "次");
    }
}
